﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using BusinessLogicLayer;
using Entities;

namespace QLNhaSach.Modules.ThongTin
{
    public partial class DanhSachPhieuThu : UserControl
    {
        DataTable table = new DataTable();
        public DanhSachPhieuThu()
        {
            InitializeComponent();
            table.Columns.Add("STT");
            table.Columns.Add("Mã phiếu thu");
            table.Columns.Add("Mã khách hàng");
            table.Columns.Add("Ngày Thu");
            table.Columns.Add("Số tiền thu");
            KhachHangBO khbo = new KhachHangBO();
            PhieuThuTienBO pttbo = new PhieuThuTienBO();
            DataTable ptt = pttbo.layDanhSachPhieuThu();
            int i = 1;
            foreach (DataRow dr in ptt.Rows)
            {
                KhachHang kh = new KhachHang();
                kh = khbo.layThongTinKhachHang(int.Parse(dr["PT_MAKHACHHANG"].ToString()));
                table.Rows.Add(i++, dr["PT_MAPHIEUTHU"].ToString(), kh.HoTenKhachHang, dr["PT_NGAYTHU"].ToString(), dr["PT_SOTIENTHU"].ToString());
            }
            gridControl1.DataSource = table;
            gridView1.Columns["Mã phiếu thu"].Visible = false;
        }

        private void simpleButton7_Click(object sender, EventArgs e)
        {
            Environment.Exit(1);
        }
    }
}
